﻿
@model DAL.Module
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link href="~/lib/layui/css/layui.css" rel="stylesheet" />
    <title>修改模块</title>
</head>
<body>
    <form class="layui-form" id="formAdd" action="">
        <input type="hidden" name="MId" value="@Model.MId" class="layui-input">
        <div class="form-group">
            <label class="layui-form-label">模块名</label>
            <div class="layui-input-inline">
                <input type="text" name="MModuleName" value="@Model.MModuleName" required lay-verify="required" placeholder="请输入模块名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="form-group">
            <label class="layui-form-label">控制器名名</label>
            <div class="layui-input-inline">
                <input type="text" name="MControllerName" value="@Model.MControllerName" required lay-verify="required" placeholder="请输入控制器名名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="form-group">
            <label class="layui-form-label">动作方法名</label>
            <div class="layui-input-inline">
                <input type="text" name="MActionName" value="@Model.MActionName" required lay-verify="required" placeholder="请输入动作方法名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="form-group">
            <label class="layui-form-label">父模块的Id</label>
            <div class="layui-input-inline">
                <input type="text" name="MParentId" value="@Model.MParentId" required lay-verify="required" placeholder="请输入父模块的Id" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="form-group">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="subData">立即提交</button>
            </div>
        </div>
    </form>
    <script src="~/lib/layui/layui.js"></script>
    <script>
        //Demo
        layui.use(['layer', 'form'], function () {
            $ = layui.jquery;
            var layer = layui.layer, form = layui.form;
            form.on('submit(subData)', function (data) {
                var str = $("#formAdd").serialize();
                $.post("/System/UpdateModule", str, function (res) {
                    if (res.status) {
                        layer.msg("修改成功", function () {
                            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                            parent.layer.close(index);
                        });
                    }
                    else
                        layer.msg("修改失败：" + res.message);
                }, "json");
                return false;
            })
        });
    </script>
</body>
</html>

